package com.recharge.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.file.entity.FileCustomer;
import com.recharge.entity.JsonRecharge;
import com.recharge.srevice.ReturnRentService;
import com.utils.JsonResult;

/**
 * @Title: ReturnRentController.java
 * @Package com.recharge.controller
 * @author 孙梦楠
 * @date 2017年11月13日 下午2:34:45
 * @version V1.0.0
 */
@RestController
@RequestMapping(value = "/rent")
public class ReturnRentController {

	@Autowired
	private ReturnRentService returnrentservice;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public JsonResult<List<JsonRecharge>> listclosing(
			@CookieValue(value = "opeorgcookie", required = false) String opeorgcookie,
			@CookieValue(value = "opetypecookie", required = false) String opetypecookie,
			@CookieValue(value = "languagecookie", required = false) String languagecookie) {

		return returnrentservice.listclosing(opetypecookie, Integer.valueOf(opeorgcookie), languagecookie);
	}

	@RequestMapping(value = "/return_rent", method = RequestMethod.POST)
	public JsonResult<String> returnrent(@RequestBody FileCustomer filecustomer,
			@CookieValue(value = "opecodecookie", required = false) String opecodecookie) {
		Integer customerid = filecustomer.getCustomerid();
		return returnrentservice.returnrent(customerid, opecodecookie);
	}

}
